
import { PureComponent } from "react";

function logRenderTime(OriginComponent){
    return class NewComponent extends PureComponent{
        componentWillMount(){
            this.start = new Date().getTime()
            console.log('开始时，',this.start);
        }
        componentDidMount(){
            this.end=new Date().getTime() 
            console.log('结束时间',this.end)
            console.log(`${OriginComponent.name}结束时间`,this.end - this.start)
        }
        render(){
            return <OriginComponent></OriginComponent>
        }
    }
}

export default logRenderTime